import java.util.Scanner;

/*输入某年某月某日，判断这一天是这一年的第几天*/
public class Exerise_14 {
    public static void main(String[] args) {
        int year;
        int month;
        int day;
        int days[] = new int[12];
        Scanner sc = new Scanner(System.in);
        System.out.println("输入年份");
        year = sc.nextInt();
        if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {
            days[1] = 29;
        } else {
            days[1] = 28;
        }
        System.out.println("输入月份");
        month = sc.nextInt();

        System.out.println("输入第几号");
        day=sc.nextInt();

        days[0] = 31;
        days[2] = 30;
        days[3] = 30;
        days[4] = 31;
        days[5] = 30;
        days[6] = 31;
        days[7] = 31;
        days[8] = 30;
        days[9] = 31;
        days[10] = 30;
        days[11]=31;
        int sum = 0;
        int sum1=0;
        for (int i = 0; i < month-1; i++) {
            sum+=days[i];
            sum1=sum+day;

        }
        System.out.println(+year+"年"+month+"月"+day+"号是"+year+"年的第"+sum1+"天");

    }
}
